<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>select</title>
    <script src="https://unpkg.com/vue@next"></script>
    <!-- 
        lazy修饰符,失去焦点才会更新双向绑定
     -->
  </head>
  <body>
    <div id="root"></div>
    <script>
      // vue的生命周期函数
      const app = Vue.createApp({
        data() {
          return {
            message: [],
            option: [
              {
                text: "A",
                value: "A1",
              },
              {
                text: "B",
                value: "B2",
              },
              {
                text: "C",
                value: "C3",
              },
            ],
            message1: false,
          };
        },
        template: `
            <div>
                {{message}}
                <select v-model="message" multiple>
                    <option v-for="item in option" :value="item.value">{{item.text}}</option>
                </select> <br>
                {{message1}}
                <input type="checkbox" v-model="message1" true-value="hello" false-value="no">
            </div>
            `,
      });
      const vm = app.mount("#root");
    </script>
  </body>
</html>
